package api

import (
	"api/basic/config"
	__ "api/basic/proto"
	"api/handler/request"
	"github.com/gin-gonic/gin"
	"net/http"
)

func Venue(c *gin.Context) {
	var form request.Venue
	// 根据 Content-Type Header 推断使用哪个绑定器。
	if err := c.ShouldBind(&form); err != nil {
		c.JSON(http.StatusBadRequest, gin.H{"error": err.Error()})
		return
	}

	list, err := config.Client.VenueList(c, &__.VenueListReq{
		Membername: form.Membername,
		Time:       form.Time,
		Title:      form.Title,
		Desc:       form.Desc,
	})
	if err != nil {
		return
	}
	c.JSON(http.StatusOK, gin.H{
		"code": 200,
		"msg":  "订阅成功",
		"data": list,
	})
}
